<?php

namespace App\Admin\Http\Requests;

class InformationRequest extends Request
{
  /**
   * Determine if the user is authorized to make this request.
   *
   * @return bool
   */
  public function authorize()
  {
    return true;
  }

  /**
   * Get the validation rules that apply to the request.
   *
   * @return array
   */
  public function rules()
    {
    return [
        'type' => 'required|max:100',
        'title' => 'required|max:100',
        'position' => 'required|max:50',
        'state' => 'required|boolean',
    ];
  }

  public function attributes()
  {
    return [
      'type' => '模板类型',
      'title' => '模板标题',
      'content' => '内容',
      'position' => '位置信息',
      'state' => '启用'
    ];
  }
}
